{% extends "account/base.html" %}

{% load css_class %}
{% load i18n %}
{% load account socialaccount %}

{% block head-title %}{% trans "Log in" %} - {% endblock %}

{% block content %}
<div class="central-form">
    <h1 class="text-center">{% if token_fail %}{% trans "Bad API Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>
    <hr>
    {% if token_fail %}
        {% url 'account_reset_password' as passwd_reset_url %}
        <p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used.  Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
    {% else %}
        {% if form %}
            <form method="POST" action=".">
                {% csrf_token %}
                {% for field in form %}
                <div class="form-group {% if field.errors %}has-error has-feedback{% endif %}">
                    <label class="control-label" for="{{ field.id_for_label }}">{{ field.label }}</label>

                    {{ field|css_class:'form-control' }}

                    {% if field.errors %}
                        {% for error in field.errors %}
                            <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
                            <span class="sr-only">(error)</span>
                            <p class="text-danger">{{ error|escape }}</p>
                        {% endfor %}
                    {% endif %}

                    {% if field.help_text %}
                        <p class="help-block">{{ field.help_text|safe }}</p>
                    {% endif %}

                </div>
                {% endfor %}
                <p><button class="btn btn-primary btn-block" type="submit">{% trans 'Change Password' %}</button></p>
            </form>
        {% else %}
            <p>{% trans 'Your password is now changed.' %}</p>
        {% endif %}
    {% endif %}

{% endblock %}


